<template>
  <div class="dow_index" v-loading="loading">
    <div class="hea"><img class="hea-img" src="@/assets/imgs/Banner.png" alt="" /></div>
    <div class="con">
      <div class="con-item" @click="handleto(android)">
        <img class="con-img" src="@/assets/imgs/and.png" alt="" />
        <div class="con-t">
          <span class="con-t1">安卓手机</span>
          <span class="con-t2">APP下载</span>
        </div>
      </div>
      <!-- <div class="con-item" @click="handleto(ios)">
        <img class="con-img" src="@/assets/imgs/ios.png" alt="" />
        <div class="con-t">
          <span class="con-t1">苹果手机</span>
          <span class="con-t2">APP下载</span>
        </div>
      </div> -->
      <div class="con-item" @click="handleto(pc)">
        <img class="con-img" src="@/assets/imgs/pclogo.png" alt="" />
        <div class="con-t">
          <span class="con-t1">PC客户端</span>
          <span class="con-t2">下载</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {
    appversionGetIsNewVersion
  } from '@/api/dataField'
  export default {
    data() {
      return {
        loading: true,
        android:'',
        ios:'',
        pc:'',
      }
    },
    mounted() {
      this.getversion()
    },
    methods: {
      getversion(){
        appversionGetIsNewVersion().then(res => {
          console.log('三端安装包',res)
          res.forEach(item=>{
            if(item.appName == 'android'){
              this.android = item.appVersion.url
            }
            if(item.appName == 'ios'){
              this.ios = item.appVersion.url
            }
            if(item.appName == 'pc'){
              this.pc = item.appVersion.url
            }
          })
          this.loading = false
        }).catch(err => {
          console.log(err)
          this.loading = false
        })
      },
      handleto(item){
        console.log(item)
        window.open(item);
      }
    }
  }
</script>

<style lang="scss" scoped>
  .dow_index{
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .hea{
      width: 100%;
      height: 45%;
      .hea-img{
        width: 100%;
        height: 100%;
      }
    }
    .con{
      flex: 1;
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: flex-start;
      .con-item{
        margin: 100px 50px;
        padding:50px;
        background-color: #f1f1f1;
        display: flex;
        justify-content: center;
        align-items: center;
        .con-img{
          width: 100px;
          height: 105px;
        }
        .con-t{
          margin-left: 20px;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          .con-t1{
            font-size: 30px;
            font-weight: 600;
            color: #333333;
          }
          .con-t2{
            margin-top: 10px;
            font-size: 20px;
            color: #636262;
          }
        }
      }
    }
  }
</style>
